package MineGod;

import java.io.IOException;
import java.util.Random;

import org.lwjgl.opengl.GL11;
import org.newdawn.slick.opengl.Texture;
import org.newdawn.slick.opengl.TextureLoader;
import org.newdawn.slick.util.ResourceLoader;

public class BlockSand extends Block {
	public static Texture sandTex;
	public BlockSand(){
		super(BlockType.sand);
		maxDurability = 50;
		durability = 50;
		obeyGravity = true;
	}


	@Override
	public Entity dropItem(double x, double y) {
		Random rand = new Random();
		if (rand.nextInt(100)<20){
			return new ItemEntityGunpowder(ItemEntityType.gunpowder, x, y);
		}else{
			return null;
		}
	}

	@Override
	public Texture getTexture() {
		return sandTex;
	}

	public static void loadTexture() {
		try {
			sandTex = TextureLoader.getTexture("PNG", ResourceLoader.getResourceAsStream("res/sand.png"));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	
	
}
